package com.kkang.ch1.di;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 启动类
 *
 * @author yongk_liu
 **/
public class Main {
    public static void main(String[] args) {
        //使用AnnotationConfigApplicationContext 作为Spring的容器，接受一个配置类
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(DiConfig.class);
        UseFunctionService bean = context.getBean(UseFunctionService.class);
        System.out.println(bean.SayHello("world!"));
        context.close();
    }

}
